package com.sh.config.web;

import com.sh.filter.JwtAuthenticationTokenFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

/**
 * @Auther: 世豪学java
 * @Date: 2023/12/17 - 12 - 17 - 13:57
 * @Decsription: com.sh.config.web
 * @version: 1.0
 */
@Configuration
//配置spring过滤器链不管理认证过滤器
//不走OncePerRequestFilter
public class WebConfig {
    @Bean
    public FilterRegistrationBean filterRegistrationBean(JwtAuthenticationTokenFilter jwtAuthenticationTokenFilter){
        FilterRegistrationBean<Filter> filterFilterRegistrationBean = new FilterRegistrationBean<>(jwtAuthenticationTokenFilter);
        filterFilterRegistrationBean.setEnabled(false);
        return filterFilterRegistrationBean;
    }
}
